﻿@model IEnumerable<PhotoGallery.Models.PhotoInfo>
@using PhotoGallery.Views
@{
    ViewBag.Title = "Preview";
}
@section javascript{
    <!-- load Galleria -->
    <script src="@Url.Content("~/Scripts/galleria/galleria-1.2.9.min.js")" type="text/javascript"></script>
    <link href="@Url.Content("~/Scripts/galleria/themes/classic/galleria.classic.css")" rel="stylesheet" type="text/css" />    
}
    <div class="content">
        <div style="text-align:right">
            @*<a href=@Url.Content("~/Gallery/List")>Back</a>*@
             <a href="@ViewBag.backUrl">@Labels.back</a>
        </div>
        
        @if (Model.Count() > 0)
        {
            <div id="galleria">
            @foreach (var photo in Model)
            {
                <img alt="@photo.Title" src="@Url.Action("DownloadPhoto", new { file = photo.FullFileName })" />
            }
            </div>
            <script>
                // Load the classic theme
                var url = "@Url.Content("~/Scripts/galleria/themes/classic/galleria.classic.min.js")"        
                Galleria.loadTheme(url); 
                // Initialize Galleria
                Galleria.run('#galleria', {
                    height:480});
            </script>
        }
        else
        {
            <div>                       
                <a href="@Url.Content("#")">
                    <img alt="" src="@Url.Content("~/Content/empty_image.png")" class="thumbnail-border" width="180" />
                </a>
                <p></p>
            </div>
        }
    </div>


